//
//  FSLSocket.swift
//  client
//
//  Created by 我演示 on 2019/11/8.
//  Copyright © 2019 ALLSall. All rights reserved.
//

import UIKit

class FSLSocket: NSObject {

    fileprivate  var tcpClient : TCPClient

    init(addr:String , port : Int) {
        tcpClient = TCPClient(addr: addr, port: port)
    }

}

extension FSLSocket {
    func connectServer() -> Bool {
        return tcpClient.connect(timeout: 5).0
        
    }
    
    @discardableResult
    func sendMsg (data : Data) {
      _ =   tcpClient.send(data: data)
    }
}
